// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 列表 */
export async function tree(body: any, options?: { [key: string]: any }) {
  return request('/api/menu/tree', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    params: body,
    ...(options || {}),
  });
}

/** 信息 */
export async function read(body: any, options?: { [key: string]: any }) {
  return request('/api/menu/read', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
    },
    params: body,
    ...(options || {}),
  });
}

/** 新增 */
export async function create(body: any, options?: { [key: string]: any }) {
  return request('/api/menu/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新 */
export async function update(body: any, options?: { [key: string]: any }) {
  return request('/api/menu/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除 */
export async function del(body: any, options?: { [key: string]: any }) {
  return request('/api/menu/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
